import com.corundumstudio.socketio.Configuration
import com.corundumstudio.socketio.SocketIOServer
import com.corundumstudio.socketio.listener.DataListener

fun main(args: Array<String>) {
    val also = SocketIOServer(
        Configuration().also { it.port = 1145 }
    ).also {
        it.start()
        it.addEventListener("message", String::class.java) { client, data, ackSender ->
            println("收到消息: $data")
            // 向客户端发送回执消息
            client.sendEvent("message", "服务器已收到消息: $data")
        }

    }
}